package com.yanqu.road.server.cmd.wingroom;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_WING_ROOM_CROSS_PULL_PLAYER_PATRONS, desc = "拉取他玩家top门客")
public class WingRoomCrossPullPlayerPatronsCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        WingRoomProto.CrossWatchOtherPlayerReqMsg reqMsg = WingRoomProto.CrossWatchOtherPlayerReqMsg.parseFrom(packet.getBytes());

        WingRoomProto.CrossWatchOtherPlayerReqMsg.Builder crossReq = WingRoomProto.CrossWatchOtherPlayerReqMsg.newBuilder();
        crossReq.setOriginServerId(serverId);
        crossReq.setOriginPlayerId(reqMsg.getWatchPlayerId());
        crossReq.setWatchPlayerId(reqMsg.getOriginPlayerId());
        MessageHelper.sendPacket(reqMsg.getOriginServerId(), reqMsg.getOriginServerId(),
                YanQuMessageUtils.buildMessage(Protocol.S_WING_ROOM_CROSS_PULL_PATRONS_REQ, crossReq));

    }

    @Override
    public void sendData() {

    }
}
